/* 全局颜色变量 */
$primary-bg: #0D1B2A;
$secondary-bg: #1B263B;
$lighter-bg: #415A77;
$paper-bg: #FDFDF0;
$accent-gold: #FFD700;
$text-light: #E0E1DD;
$text-dark: #778DA9;
$text-on-paper: #333;
$wechat-green: #07C160;
$status-blue: #3498db;
$status-green: #2ecc71;
$status-grey: #95a5a6;

/* 页面基础样式 */
page {
  background-color: $primary-bg;
  color: $text-light;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 28rpx;
  line-height: 1.6;
}

/* 全局重置样式 */
* {
  box-sizing: border-box;
}

/* 全局通用类 */
.u-flex {
  display: flex;
}

.u-flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.u-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.u-flex-column {
  display: flex;
  flex-direction: column;
}

.u-text-center {
  text-align: center;
}

/* 全局按钮样式 */
.u-btn {
  padding: 30rpx 60rpx;
  border-radius: 16rpx;
  font-size: 28rpx;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  border: none;
  
  &:active {
    transform: scale(0.95);
  }
  
  &.u-btn-primary {
    background-color: $accent-gold;
    color: $primary-bg;
    
    &:disabled {
      background-color: $text-dark;
      color: #aaa;
      opacity: 0.7;
    }
  }
}

/* 全局输入框样式 */
.u-input {
  padding: 30rpx;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2rpx solid $text-dark;
  border-radius: 16rpx;
  color: $text-light;
  font-size: 28rpx;
  transition: border-color 0.3s ease;
  
  &::placeholder {
    color: $text-dark;
  }
  
  &:focus {
    border-color: $accent-gold;
    outline: none;
  }
}

/* 全局卡片样式 */
.u-card {
  background-color: rgba(27, 38, 59, 0.7);
  backdrop-filter: blur(30rpx);
  border-radius: 24rpx;
  border: 1rpx solid rgba(119, 141, 169, 0.3);
  box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.2);
  padding: 40rpx;
}

/* 全局状态标签样式 */
.u-status-tag {
  padding: 8rpx 16rpx;
  border-radius: 12rpx;
  font-size: 24rpx;
  font-weight: 500;
  
  &.u-status-floating {
    background-color: $status-blue;
    color: white;
  }
  
  &.u-status-opened {
    background-color: $status-green;
    color: white;
  }
  
  &.u-status-lost {
    background-color: $status-grey;
    color: white;
  }
  
  &.u-status-collected {
    background-color: $accent-gold;
    color: $primary-bg;
  }
}

/* 安全区域适配 */
.u-safe-area-top {
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
}

.u-safe-area-bottom {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

/* 全局页面切换动画 */
.u-page-enter {
  animation: u-page-enter 0.5s ease-out;
}

@keyframes u-page-enter {
  from {
    opacity: 0;
    transform: translateY(40rpx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
  width: 8rpx;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: $text-dark;
  border-radius: 8rpx;
}

/* 全局椭圆省略号 */
.u-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 全局遮罩层 */
.u-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
} 